import request from '../utils/request'

// 登陆
export function login (form) {
    return request({
        url: '/auth/login',
        method: 'post',
        params: {
            username: form.username,
            password: form.password
        }
    })
}

// 退出
export function logout () {
    return request({
        url: '/auth/auth/logout',
        method: 'post'
    })
}

// 获取access_token
export function accessToken (form) {
    return request({
        url: '/auth/oauth/token',
        method: 'post',
        params: {
            client_id: 'c1',
            client_secret: '123456',
            grant_type: 'password',
            username: form.username,
            password: form.password
        }
    })
}
